<div class="hbox hbox-auto-xs hbox-auto-sm" ng-controller="UserProfilesCtrl" >
  <div class="col">
    <div style="background:url(img/c4.jpg) center center; background-size:cover">
      <div class="wrapper-lg bg-white-opacity">
        <div class="row m-t">
          <div class="col-sm-7">
            <a ng-click="pictureUpload()" class="thumb-lg pull-left m-r">
              <img ng-src="/suite/plugins/servlet/getUserAvatar?user={{userprofiles.userName}}&{{userPhotoTimestamp}}" class="img-circle">
            </a>
            <div class="clear m-b">
              <div class="m-b m-t-sm">
                <span class="h3 text-black">{{userprofiles.firstName}}</span>

                <span class="label bg-info m-l-sm" >{{userprofiles.customField2}}</span>
              </div>
              <p class="m-b">
                <p class="m-sm"><i class="fa fa-map-marker"></i>{{userprofiles.address1}}</p>
                <p class="m-sm" ><i class="fa fa-phone"></i> {{userprofiles.phoneOffice}}</p>
                <p class="m-sm" ><i class="glyphicon glyphicon-envelope"></i> {{userprofiles.email}}</p>
              </p>
             <!-- <div ng-hide="userInfo.userName==userprofiles.userName" >
                <a href ng-show="userprofiles.isFollow==false" class="btn btn-sm btn-success btn-rounded">关注</a>
                <a href ng-show="userprofiles.isFollow==true" class="btn btn-sm btn-success btn-rounded">已关注</a>
              </div>-->
            </div>
          </div>
          <!--<div class="col-sm-5">
            <div class="pull-right pull-none-xs text-center">
              <a href class="m-b-md inline m">
                <span class="h3 block font-bold">{{userprofiles.followCount}}</span>
                <small>关注</small>
              </a>
            </div>
          </div>-->
        </div>
      </div>
    </div>
		<div style="margin:15px;clear:both;">
		<div ng-controller="UserProfilesNewsCtrl"  > 
			<div class="news-tabs" style="  margin-top: 0px;" >
                    <ul class="nav nav-tabs nav-sm pull-left">
                        <li>
							<a ng-show="userInfo.userName==userprofiles.userName" >我发布的新闻</a>
							<a ng-show="userInfo.userName!=userprofiles.userName" >他（她）发布的新闻</a>
						<li>
                    </ul>
                    <div class="pull-right search-input">
                        <div class="input-group">
                            <input type="text" id="searchNewsText" ng-model="searchNewsText" ng-keydown="searchNews($event)" class="form-control" placeholder="{{'news.searchNews'|translate}}">
                        </div>

                    </div>
                    <div class="clearfix"></div>
               </div>
			<div class="news-list" >
                    <ul>
                        <li class="news" id="news{{news.id}}" ng-mouseenter="browseNews(news.id,news.my_is_browse_news,news.my_is_browse_new_comment)" ng-repeat="news in newss" >
                            <div>
                                <a href="#/app/userprofile/{{news.publisher}}" class="pull-left thumb-sm avatar m-l-n-md">
                                    <img src="/suite/plugins/servlet/getUserAvatar?user={{news.publisher}}" class="img-circle" alt="...">
                                </a>
                                <div class="m-l-lg">
                                    <div class="m-b-xs">
                                       <span style="word-break: break-all;" ng-class="contentCss(news.have_to_comment)" > <a href="#/app/userprofile/{{news.publisher}}" >{{news.publisher_firstname}}</a>

                                           <span ng-show="news.is_content_cut==true" ><span  ng-bind-html="news.content_cut" ></span>&nbsp;&nbsp;<a ng-click="showContentFull(news.row_index)" ><i class="fa fa-angle-double-down m-r-xs"  ></i>{{'news.fullText'|translate}}</a></span>
                                            <span ng-show="news.is_content_cut==false" ng-bind-html="news.content" ></span>&nbsp;&nbsp;<a ng-show="news.is_content_full==true" ng-click="hideContentFull(news.row_index)" ><i class="fa fa-angle-double-up m-r-xs"  ></i>{{'news.retract'|translate}}</a>
                                           &nbsp;<i class="fa fa-lock text" ng-show="news.is_lock==1"  ></i>&nbsp;
                                           <span ng-show="news.have_to_comment==1" class="text-warning" > ( <i class="fa fa-exclamation-triangle" ></i> {{'news.newsTabs.inComments'|translate}} )</span>
                                        <span style="display: block;color: #c3c3c3;margin-bottom: 15px;" ><i class="fa fa-clock-o text-muted"></i> {{news.publisher_datetime | fromNow}}&nbsp;&nbsp;<span ng-show="news.address!=null&&news.address!=''" >{{'news.publishedIn'|translate}}{{news.address}}</span>&nbsp;&nbsp;{{'news.update'|translate}} {{news.update_datetime | fromNow}}</span>
                                           <!-- <span class="text-muted m-l-sm pull-right">
                                              {{news.publisher_datetime | fromNow}}
                                            </span>-->
                                    </div>
                                    <div >
                                        <div class="m-t-xs" ng-show="news.attachments.length">

                                            <div class="img-list-view"  ng-repeat="attachment in news.attachments" ng-show="attachment.type=='image'" >
                                                <a ng-click="documentsView(attachment.id,news.attachments)">
                                                    <div style="
                                                        background-image: url(/suite/doc/{{attachment.id}});
                                                        width: 100%;
                                                        height: 100%;
                                                        background-position: center;
                                                        background-size: cover;"></div>
                                                </a>
                                            </div>
                                            <div class="file-item m-t-xs file-list-view" ng-repeat="attachment in news.attachments" ng-hide="attachment.type=='image'" >

                                                <a  ng-click="documentsView(attachment.id,news.attachments)" >
                                                    <span ng-show="attachment.type=='file'" >
                                                        <span  class="m-r-sm bg-primary document-icon" >{{attachment.suffix}}</span>
                                                        <span ng-bind-html="attachment.name | limitTo:100"></span>.{{attachment.suffix}}
                                                    </span>
                                                    <span ng-show="attachment.type=='report'" >
                                                        <i class="text-warning fa fa-bar-chart-o m-r-sm" style="font-size: 30px;line-height: 10px;vertical-align: middle;" ></i>
                                                        <span ng-bind-html="attachment.name | limitTo:100"></span>.{{attachment.suffix}}
                                                    </span>
                                                    <span ng-show="attachment.type=='preview'" >
                                                        <span  class="m-r-sm bg-danger document-icon" >{{attachment.suffix}}</span>
                                                        <span ng-bind-html="attachment.name | limitTo:100"></span>.{{attachment.suffix}}
                                                    </span>
                                                    <span ng-show="attachment.type=='openOffice'" >
                                                        <span  class="m-r-sm bg-danger document-icon" >{{attachment.suffix}}</span>
                                                        <span ng-bind-html="attachment.name | limitTo:100"></span>.{{attachment.suffix}}
                                                    </span>
                                                    <span ng-show="attachment.type=='video'" >
                                                        <span  class="m-r-sm bg-dark document-icon" >{{attachment.suffix}}</span>
                                                        <span ng-bind-html="attachment.name | limitTo:100"></span>.{{attachment.suffix}}
                                                    </span>
                                                </a>
                                            </div>

                                        </div>
                                        <div class="m-t-xs processmodel-list-view"" ng-repeat="processmodel in news.processmodels" >
                                        <a ui-sref="app.processmodelinfo({processModelId:processmodel.id})"><i class="fa fa-sitemap "
                                                                                                               style="font-size:15px;line-height:15px;vertical-align: middle;"></i>
                                            <span style="line-height:12px;vertical-align: middle;"> <span  ng-bind-html="processmodel.name" ></span></span></a>
                                    </div>
                                    <div class="m-t-xs record-list-view" ng-repeat="record in news.records">
                                        <a ng-show="record.type=='process'" href="#/app/{{record.id}}" ><i class="iconfont icon-danganliebiao"
                                                                                                           style="font-size:15px;line-height:15px;vertical-align: middle;"></i><span
                                                style="line-height:12px;vertical-align: middle;"> <span  ng-bind-html="record.name" ></span> </span></a>
                                        <a ng-show="record.type=='custom'" href="#/app/records/{{record.id}}" ><i class="iconfont icon-danganliebiao"
                                                                                                                  style="font-size:15px;line-height:15px;vertical-align: middle;"></i><span
                                                style="line-height:12px;vertical-align: middle;"> <span  ng-bind-html="record.name" ></span> </span></a>
                                    </div>
                                    <div class="m-t-sm comment-tools"   >
                                        <a href ui-toggle-class class="m-xs" ng-click="setFavorite(news.id,news.favorite,news.row_index)" ng-class="isFavorite(news.favorite)" >
                                            <i class="fa fa-star text-warning text-active" > {{news.favorite_count}}</i>
                                            <i class="fa fa-star-o  text" style="color:#98a6ad;"  > {{news.favorite_count}}</i>

                                        </a>
                                        <a href class="text-muted m-xs" ng-show="news.participant_count==0" style="position: relative;">
                                            <i class="icon-users text-muted"> {{'news.allPeople'|translate}}</i>
                                        </a>
                                        <a href class="text-muted m-xs" ng-show="news.participant_count>0" id="participantsLink{{news.id}}" ng-mouseenter="showParticipants(news.id,news.row_index)" ng-mouseleave="hideParticipants(news.id)" style="position: relative;">
                                            <i class="icon-users text-muted"> {{news.participant_count}}</i>
                                        </a>

                                        <div class="participants" ng-mouseenter="showParticipantsPanel(news.id)" ng-mouseleave="hideParticipantsPanel(news.id)"  id="participantsPanel{{news.id}}" style="display: none;"  >
                                            <p>{{'news.participants'|translate}}</p>
                                            <div class="input-group m-b-sm" ng-show="news.is_lock==0||news.publisher==userInfo.userName" >
                                                <select id="addParticipants{{news.id}}" class="add-participants" multiple="multiple"></select>
                                                </select>
                                                <div class="input-group-btn" >
                                                    <button class="btn btn-success btn-sm " style="border-radius: 2px;margin-left: 4px;" type="button" ng-click="addParticipants(news.id,news.row_index)" >{{'common.add'|translate}}</button>
                                                </div>
                                            </div>

                                            <ul class="list-group alt">
                                                <li class="list-group-item" ng-repeat="participant in news.participants" >
                                                    <div class="media">
                                                        <span class="pull-left thumb-sm"><img src="/suite/plugins/servlet/getUserAvatar?user={{participant.participant_id}}" style="height:35px" class="img-circle"></span>
                                                        <div class="pull-right">
                                                            <i class="fa fa-eye  text-success" ng-show="participant.is_browse_news" style="display: block;line-height: 20px;" > {{'news.newsTabs.alreadyBrowse'|translate}}</i>
                                                            <span style="display: block;color: #c3c3c3;" ng-show="participant.browse_news_datetime!=''&&participant.browse_news_datetime!=null"  >&nbsp;&nbsp;{{participant.browse_news_datetime | fromNow}}</span>
                                                        </div>
                                                        <div class="media-body">
                                                            <div><a href="">{{participant.participant_firstname}}</a></div>
                                                            <small class="text-muted">{{participant.participant_position}}</small>
                                                        </div>
                                                    </div>
                                                </li>
                                            </ul>
                                        </div>


                                        <a href class="text-muted m-xs" ng-click="showComment({{news.id}})">
                                            <i class="icon-bubbles text-muted"> {{'common.comment'|translate}}</i>
                                        </a>
                                        <a href class="text-muted m-xs"  ng-click="deleteNews(news.id,news.row_index,'{{'common.areYouSureYouWantToDeleteIt'|translate}}')" ng-show="news.publisher==userInfo.userName " >
                                            <i class="icon-close text-muted"> {{'common.delete'|translate}}</i>
                                        </a>
                                    </div>
                                    <div id="comment{{news.id}}" style="display: none;" class="comment panel panel-default  m-b-n-sm pos-rlt m-t-xs "  >
                                        <form>
                                            <textarea id="commentText{{news.id}}" class="form-control no-border" rows="3" placeholder="请输入评论内容..."></textarea>
                                        </form>
                                        <div ng-show="commentAttachs[news.id].length>0" class="panel-footer bg-light lter " >
                                            <div class="file-item" ng-repeat="document in commentAttachs[news.id]" >
                                                <a  ng-click="documentsView(document.id,commentAttachs[news.id])" style="color: #000" >
                                                    <span ng-show="document.mimeType=='file'" >
                                                        <span  class="m-r-sm bg-primary document-icon" >{{document.suffix}}</span>
                                                        <span ng-bind-html="document.name | limitTo:100"></span>.{{document.suffix}} {{document.size}}
                                                    </span>
                                                    <span ng-show="document.mimeType=='report'" >
                                                        <i class="text-warning fa fa-bar-chart-o m-r-sm" style="font-size: 30px;line-height: 10px;vertical-align: middle;" ></i>
                                                        <span ng-bind-html="document.name | limitTo:100"></span>.{{document.suffix}} {{document.size}}
                                                    </span>
                                                    <span ng-show="document.mimeType=='preview'" >
                                                        <span  class="m-r-sm bg-danger document-icon" >{{document.suffix}}</span>
                                                        <span ng-bind-html="document.name | limitTo:100"></span>.{{document.suffix}} {{document.size}}
                                                    </span>
                                                    <span ng-show="document.mimeType=='openOffice'" >
                                                        <span  class="m-r-sm bg-danger document-icon" >{{document.suffix}}</span>
                                                        <span ng-bind-html="document.name | limitTo:100"></span>.{{document.suffix}} {{document.size}}
                                                    </span>
                                                    <span ng-show="document.mimeType=='video'" >
                                                        <span  class="m-r-sm bg-dark document-icon" >{{document.suffix}}</span>
                                                        <span ng-bind-html="document.name | limitTo:100"></span>.{{document.suffix}} {{document.size}}
                                                    </span>
                                                    <span ng-show="document.mimeType=='image'" >
                                                        <img ng-src="{{document.mimeType=='image' ? '/suite/plugins/servlet/loadSource/'+document.id+'?timestamp='+timestamp : ''}}" style="width: 38px;height: 38px;margin-right: 10px;" />
                                                        <span ng-bind-html="document.name | limitTo:100"></span>.{{document.suffix}} {{document.size}}
                                                    </span>
                                                </a>
                                                <a style="color: #000"  ng-click="cleanCommentContent(document,news.id)" >&nbsp;&nbsp;<i class="glyphicon glyphicon-remove"></i></a>
                                            </div>
                                        </div>

                                        <div class="comment panel-footer bg-light lter">
                                            <button class="btn btn-info pull-right btn-sm" ng-click="addComment(news.id,news.row_index)" >{{'news.comment'|translate}}</button>
                                            <ul class="nav nav-pills nav-sm news-tools">
                                                <li>
                                                    <form id="attachUploadImg{{news.id}}Form" action="/suite/plugins/servlet/uploadDocument" method="post"
                                                          enctype="multipart/form-data" target="ifm"><input type="hidden" name="folder" value="9">
                                                        <a href="javascript:;" class="a-i-upload" ><input id="attachUploadImg{{news.id}}" newsId="{{news.id}}" name="uploadDocumentFile"
                                                                                                          type="file" flag="{{news.id}}"
                                                                                                          onchange="angular.element(this).scope().selectedFileByComment(this)"
                                                                                                          style="width:206px;"><i class="icon-paper-clip"
                                                                                                                                  style="line-height:16px;vertical-align: middle;"></i></a>
                                                    </form>
                                                </li>
                                                <li>
                                                    <form id="attachUploadFile{{news.id}}Form" action="/suite/plugins/servlet/uploadDocument" method="post"
                                                          enctype="multipart/form-data" target="ifm"><input type="hidden" name="folder" value="9">
                                                        <a href="javascript:;" class="a-i-upload" ><input id="attachUploadFile{{news.id}}" newsId="{{news.id}}" name="uploadDocumentFile"
                                                                                                          type="file" flag="{{news.id}}"
                                                                                                          onchange="angular.element(this).scope().selectedFileByComment(this)"
                                                                                                          style="width:206px;" accept="image/*" ><i class="fa fa-camera"
                                                                                                                                                    style="line-height:16px;vertical-align: middle;"></i></a>
                                                    </form>
                                                </li>
                                            </ul>
                                        </div>
                                    </div>
                                    <div ng-show="news.comment_count>=1" class="comment-wrap m-t-sm">

                                        <div ng-repeat="comment in news.comments"  >
                                            <a href="#/app/userprofile/{{comment.publisher}}" class="pull-left thumb-xs avatar">
                                                <img src="/suite/plugins/servlet/getUserAvatar?user={{comment.publisher}}" alt="...">
                                            </a>
                                            <div class="content m-l-xxl b-a panel m-b-xs">
                                                <div style="word-break: break-all;"  class="panel-heading pos-rlt">
                                                          <span class="text-muted m-l-sm pull-right">
                                                            {{comment.publisher_datetime | fromNow}}
                                                          </span>
                                                    <a href="#/app/userprofile/{{comment.publisher}}" >{{comment.publisher_firstname}}</a>
                                                    <span  ng-bind-html="comment.content" ></span>
                                                    <div class="m-t-xs" ng-show="comment.attachments.length">
                                                        <div class="img-list-view"  ng-repeat="attachment in comment.attachments" ng-show="attachment.type=='image'" >
                                                            <a ng-click="documentsView(attachment.id,comment.attachments)">
                                                                <div style="
                                                        background-image: url(/suite/doc/{{attachment.id}});
                                                        width: 100%;
                                                        height: 100%;
                                                        background-position: center;
                                                        background-size: cover;"></div>
                                                            </a>
                                                        </div>
                                                        <div class="file-item m-t-xs file-list-view" ng-repeat="attachment in comment.attachments" ng-hide="attachment.type=='image'" >

                                                            <a  ng-click="documentsView(attachment.id,comment.attachments)" >
                                                                <span ng-show="attachment.type=='file'" >
                                                                    <span  class="m-r-sm bg-primary document-icon" >{{attachment.suffix}}</span>
                                                                    <span ng-bind-html="attachment.name | limitTo:100"></span>.{{attachment.suffix}}
                                                                </span>
                                                                <span ng-show="attachment.type=='report'" >
                                                                    <i class="text-warning fa fa-bar-chart-o m-r-sm" style="font-size: 30px;line-height: 10px;vertical-align: middle;" ></i>
                                                                    <span ng-bind-html="attachment.name | limitTo:100"></span>.{{attachment.suffix}}
                                                                </span>
                                                                <span ng-show="attachment.type=='preview'" >
                                                                    <span  class="m-r-sm bg-danger document-icon" >{{attachment.suffix}}</span>
                                                                    <span ng-bind-html="attachment.name | limitTo:100"></span>.{{attachment.suffix}}
                                                                </span>
                                                                <span ng-show="attachment.type=='openOffice'" >
                                                                    <span  class="m-r-sm bg-danger document-icon" >{{attachment.suffix}}</span>
                                                                    <span ng-bind-html="attachment.name | limitTo:100"></span>.{{attachment.suffix}}
                                                                </span>
                                                                <span ng-show="attachment.type=='video'" >
                                                                    <span  class="m-r-sm bg-dark document-icon" >{{attachment.suffix}}</span>
                                                                    <span ng-bind-html="attachment.name | limitTo:100"></span>.{{attachment.suffix}}
                                                                </span>
                                                            </a>
                                                        </div>

                                                    </div>

                                                </div>
                                            </div>
                                        </div>
                                        <div class="m-b-sm m-l-xs" style="text-align: center;" ng-show="news.comment_count>3" ><a href ng-click="viewAllComments(news.id,news.row_index)" >
                                            <span style="line-height:18px;vertical-align: middle;" ng-show="news.is_show_comments!=1" ><i class="fa fa-angle-double-down m-r-xs" style="font-size:16px;line-height:18px;vertical-align: middle;"></i> {{'news.showAll'|translate}} {{news.comment_count}} {{'news.articleComments'|translate}} </span>
                                            <span style="line-height:18px;vertical-align: middle;" ng-show="news.is_show_comments==1" ><i class="fa fa-angle-double-up m-r-xs" style="font-size:16px;line-height:18px;vertical-align: middle;"></i> {{'news.hideComments'|translate}} </span>
                                        </a>
                                        </div>

                                    </div>

                                </div>
                            </div>
                        </li>
                        <li  class="no-news" ng-show="newss.length==0"  >
                            <div style="text-align: center;margin-top: 20px;" ><i class="iconfont  icon-meiyousoudaoxinxi" style="font-size: 23px;" ></i>
                                <span ng-show="filterValue=='myPublish'" > &nbsp;
								<span ng-show="userInfo.userName==userprofiles.userName" >我</span>
								<span ng-show="userInfo.userName!=userprofiles.userName" >他（她）</span>没有发布过新闻。</span>
                            </div>
                        </li>
                    </ul>
                </div>
            </div>
		</div>
	</div>
  <div class="col w-lg bg-light lter b-l bg-auto">
    <div class="wrapper">
      <!--<div class="">
        <h4 class="m-t-xs m-b-xs">关注他（她）的人</h4>
        <ul ng-show="userprofiles.follows.length>0" class="list-group no-bg no-borders pull-in">
          <li class="list-group-item" ng-repeat="follow in userprofiles.follows" >
            <a ui-sref="app.userprofile({user:follow.userName})"  class="pull-left thumb-sm avatar m-r">
              <img src="/suite/plugins/servlet/getUserAvatar?user={{follow.userName}}"  alt="..." class="img-circle">
              <i class="on b-white bottom"></i>
            </a>
            <div class="clear">
              <div><a ui-sref="app.userprofile({user:follow.userName})" >{{follow.firstName}}</a></div>
              <small class="text-muted">{{follow.customField2}}</small>
            </div>
          </li>
        </ul>
        <ul  ng-show="userprofiles.follows.length==0" class="list-group no-bg no-borders pull-in">
          <li class="list-group-item"  >
            &nbsp;&nbsp;没有关注的人
          </li>
        </ul>
      </div>-->
      <div class="">
        <h4 class="m-t-xs m-b-xs">直属上级</h4>
        <ul ng-show="userprofiles.supervisorName!=null"  class="list-group no-bg no-borders pull-in">
          <li class="list-group-item"  >
            <a ui-sref="app.userprofile({user:userprofiles.supervisorName})"  class="pull-left thumb-sm avatar m-r">
              <img src="/suite/plugins/servlet/getUserAvatar?user={{userprofiles.supervisorName}}"  alt="..." class="img-circle">
              <i class="on b-white bottom"></i>
            </a>
            <div class="clear">
              <div><a ui-sref="app.userprofile({user:userprofiles.supervisorName})" >{{userprofiles.supervisorFirstName}}</a></div>
              <small class="text-muted">{{userprofiles.supervisorCustomField2}}</small>
            </div>
          </li>
        </ul>
      </div>
    </div>
  </div>
</div>
<script>
 function formatState(state) {
        if (!state.id) {
            return state.name;
        }
        var text=""
        if(state.type=="user"){
            text='<span class="thumb-xs avatar" ><img  src="/suite/plugins/servlet/getUserAvatar?user='+state.id+'" />&nbsp;&nbsp;' + state.name + ' ( '+state.title+' ) </span>';
        }else{
            text='<span class="thumb-xs avatar" ><img  src="/suite/plugins/servlet/loadSource/3/group.png" />&nbsp;&nbsp;' + state.name + '</span>';
        }
        var $state = $(
                text
        );
        return $state;
    }
    ;
    function formatRepoSelection(repo) {
        return repo.name || repo.text;
    }
</script>